<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js"></script>
    
</head>
<body>
    <script>
        axios.interceptors.request.use(config1=>{
            return config1
        }, error1=>{
            return Promise.reject(error1);
        })

        axios.interceptors.request.use(config2=>{
            return config2
        }, error2=>{
            return Promise.reject(error2);
        })

        axios.interceptors.response.use(response1=>{
            return response1
        }, error1=>{
            return Promise.reject(error1);
        })

        axios.interceptors.response.use(response2=>{
            return response2
        }, error2=>{
            return Promise.reject(error2);
        })

        console.dir(axios);

        // 通过分析原生的得出一下结论
        // use 时，会向 handlers数组中push 成功和失败的回调
        // 1. axios.interceptors.request.use
        //    axios.interceptors.request.handlers
        // 2. axios.interceptors.response.use

        
    </script>
</body>
</html>